package com.mallcloud.mall.common.core.constant.enums.mall;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 *
 */
@Getter
@AllArgsConstructor
public enum AppSettingEnum {

	APP_SETTING_TYPE("app_setting_type", "app设置字典"),
	;

	private final String type;
	private final String description;

	@Getter
	@AllArgsConstructor
	public enum TypeEnum {
		TYPE_1("1", "首页轮播图"),
		TYPE_2("2", "首页菜单"),
		TYPE_3("3", "首页通知"),
		TYPE_4("4", "我的菜单"),
		TYPE_5("5", "停车"),
		TYPE_6("6", "我的订单"),
		;
		private String code;
		private String description;

		public static String getDecs(Integer type) {
			return Arrays.stream(values()).filter(x -> x.getCode().equals(type)).findFirst().get().getDescription();
		}
	}
}
